package com.xuecheng.api.learning.model.vo;

import com.xuecheng.common.domain.code.ErrorCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 媒资播放信息
 */
@Data
@ApiModel(value="ResourceUrlModel", description="获取直播流/点播/文档地址")
public class ResourceUrlModel {
    @ApiModelProperty("直播推流地址")
    String pushUrl;
    @ApiModelProperty("课程播放地址")
    String playUrl;
    @ApiModelProperty("资源状态")
    Integer state;
    @ApiModelProperty("资源信息")
    String message;

    public ResourceUrlModel() {
        this.state = 0;
    }

    public ResourceUrlModel(Integer state) {
        this.state = state;
    }
  
    public void wrong(ErrorCode errorCode) {
        this.setState(errorCode.getCode());
        this.setMessage(errorCode.getDesc());
    }
    public void wrong(Integer state, String message) {
        this.setState(state);
        this.setMessage(message);
    }
}